package com.bohua.child.controller;

import com.bohua.child.common.Lay;
import com.bohua.child.common.Msg;
import com.bohua.child.entity.Shuttle;
import com.bohua.child.service.ShuttleService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
/**
 * 学生安全表控制器
 * @author shichenyang
 * @email gyv12345@163.com
 * @date 2019/01/17
 */
@Controller
@RequestMapping("/shuttle")
public class ShuttleController {
    @Resource
    private ShuttleService shuttleService;

    @RequestMapping
    public String shuttle(){
        return "shuttle/shuttle.html";
    }
    @RequestMapping("/add")
    public String add(){
        return "shuttle/addShuttle.html";
    }

    @RequestMapping("/update")
    public String update(){
        return "shuttle/updateShuttle.html";
    }

    @RequestMapping("/getShuttles")
    @ResponseBody
    public Lay getShuttles(Shuttle shuttle,Integer page,Integer limit){
        return shuttleService.getShuttles(shuttle,page,limit);
    }
    @RequestMapping("/addShuttle")
    @ResponseBody
    public Msg addShuttle(Shuttle shuttle){
        return shuttleService.addShuttle(shuttle);
    }

    @RequestMapping("/updateShuttle")
    @ResponseBody
    public Msg updateShuttle(Shuttle shuttle){
        return shuttleService.updateShuttle(shuttle);
    }

    @RequestMapping("/delShuttle")
    @ResponseBody
    public Msg delShuttle(Shuttle shuttle){
        return shuttleService.delShuttle(shuttle);
    }
}
